import React, {Component} from 'react'
import { connect } from 'dva';
import { Player ,ControlBar,VolumeMenuButton,PlaybackRateMenuButton} from 'video-react';
import "../../node_modules/video-react/dist/video-react.css";
class Videoplay extends Component {
  constructor(props) {
    super(props)
    this.state = {
      videourl:'http://1253153042.vod2.myqcloud.com/27185859vodgzp1253153042/771bd65a5285890781585682248/ouCdM08D20cA.mp4', //视频链接地址
      videoposter:'https://tse1.mm.bing.net/th?id=OIP.UBPZGrmITm698OaILLRuHQHaKk&pid=Api', //视频封面
      videoava:'', //当前用户可否观看视频
      classname:'', //当前课程名
      chapter:'', //当前章节名
      chapternotes:[], //当前章节笔记

    }
  }

  componentDidMount() {
  }
  render(){
    return (
      <div>
        <Player
          playsInline
          poster={this.state.videoposter}
          src={this.state.videourl}
        >
          <ControlBar>
            <VolumeMenuButton vertical/>
            <PlaybackRateMenuButton
              rates={[ 2, 1.5, 1, 0.5]}
              order={7.1}
            />
          </ControlBar>
        </Player>
      </div>
    )
  }
}

Videoplay.propTypes = {
};
/** 
function mapStateToProps() {
}
*/
export default connect()(Videoplay);
